

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="zh" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Distributions &mdash; Optuna 1.4.0 文档</title>
  

  
  
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
  
  
  

  
  <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
    <link rel="index" title="索引" href="../genindex.html" />
    <link rel="search" title="搜索" href="../search.html" />
    <link rel="next" title="Exceptions" href="exceptions.html" />
    <link rel="prev" title="Command Line Interface" href="cli.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home"> Optuna
          

          
          </a>

          
            
            
              <div class="version">
                1.4.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">目录</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">安装</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">教程</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="core.html">Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="cli.html">Command Line Interface</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="exceptions.html">Exceptions</a></li>
<li class="toctree-l2"><a class="reference internal" href="importance.html">Hyperparameter Importance</a></li>
<li class="toctree-l2"><a class="reference internal" href="integration.html">Integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="logging.html">Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="multi_objective/index.html">Multi-objective</a></li>
<li class="toctree-l2"><a class="reference internal" href="pruners.html">Pruners</a></li>
<li class="toctree-l2"><a class="reference internal" href="samplers.html">Samplers</a></li>
<li class="toctree-l2"><a class="reference internal" href="storages.html">Storages</a></li>
<li class="toctree-l2"><a class="reference internal" href="structs.html">Structs</a></li>
<li class="toctree-l2"><a class="reference internal" href="study.html">Study</a></li>
<li class="toctree-l2"><a class="reference internal" href="trial.html">Trial</a></li>
<li class="toctree-l2"><a class="reference internal" href="visualization.html">Visualization</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../faq.html">常见问题</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">Optuna</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html">Docs</a> &raquo;</li>
        
          <li><a href="index.html">API Reference</a> &raquo;</li>
        
      <li>Distributions</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/reference/distributions.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <span class="target" id="module-optuna.distributions"></span><div class="section" id="distributions">
<h1>Distributions<a class="headerlink" href="#distributions" title="永久链接至标题">¶</a></h1>
<dl class="py class">
<dt id="optuna.distributions.UniformDistribution">
<em class="property">class </em><code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">UniformDistribution</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span></em>, <em class="sig-param"><span class="n">high</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#UniformDistribution"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.UniformDistribution" title="永久链接至目标">¶</a></dt>
<dd><p>线性域的均匀分布。</p>
<p>一般情况下，该对象由 <a class="reference internal" href="trial.html#optuna.trial.Trial.suggest_uniform" title="optuna.trial.Trial.suggest_uniform"><code class="xref py py-func docutils literal notranslate"><span class="pre">suggest_uniform()</span></code></a> 进行实例化，然后被传递到 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a>.</p>
<dl class="py attribute">
<dt id="optuna.distributions.UniformDistribution.low">
<code class="sig-name descname">low</code><a class="headerlink" href="#optuna.distributions.UniformDistribution.low" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围下界。其中 <code class="docutils literal notranslate"><span class="pre">low</span></code> 值是包含在取值范围内的。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.distributions.UniformDistribution.high">
<code class="sig-name descname">high</code><a class="headerlink" href="#optuna.distributions.UniformDistribution.high" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围上界。其中 <code class="docutils literal notranslate"><span class="pre">high</span></code> 值是不包含在取值范围内的。</p>
</dd></dl>

<dl class="py method">
<dt id="optuna.distributions.UniformDistribution.single">
<code class="sig-name descname">single</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#UniformDistribution.single"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.UniformDistribution.single" title="永久链接至目标">¶</a></dt>
<dd><p>测试该分布范围内是否仅包含一个可能的值。</p>
<p>如果该方法返回 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 则 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a> 总从该分布中取同一个值。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>当分布的范围内仅包含一个值时该值为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 否则为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="optuna.distributions.LogUniformDistribution">
<em class="property">class </em><code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">LogUniformDistribution</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span></em>, <em class="sig-param"><span class="n">high</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#LogUniformDistribution"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.LogUniformDistribution" title="永久链接至目标">¶</a></dt>
<dd><p>Log 均匀分布</p>
<p>该对象由 <a class="reference internal" href="trial.html#optuna.trial.Trial.suggest_loguniform" title="optuna.trial.Trial.suggest_loguniform"><code class="xref py py-func docutils literal notranslate"><span class="pre">suggest_loguniform()</span></code></a> 进行实例化之后会被传递到 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a></p>
<dl class="py attribute">
<dt id="optuna.distributions.LogUniformDistribution.low">
<code class="sig-name descname">low</code><a class="headerlink" href="#optuna.distributions.LogUniformDistribution.low" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围下界。其中 <code class="docutils literal notranslate"><span class="pre">low</span></code> 值是包含在取值范围内的。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.distributions.LogUniformDistribution.high">
<code class="sig-name descname">high</code><a class="headerlink" href="#optuna.distributions.LogUniformDistribution.high" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围上界。其中 <code class="docutils literal notranslate"><span class="pre">high</span></code> 值是不包含在取值范围内的。</p>
</dd></dl>

<dl class="py method">
<dt id="optuna.distributions.LogUniformDistribution.single">
<code class="sig-name descname">single</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#LogUniformDistribution.single"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.LogUniformDistribution.single" title="永久链接至目标">¶</a></dt>
<dd><p>测试该分布范围内是否仅包含一个可能的值。</p>
<p>如果该方法返回 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 则 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a> 总从该分布中取同一个值。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>当分布的范围内仅包含一个值时该值为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 否则为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="optuna.distributions.DiscreteUniformDistribution">
<em class="property">class </em><code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">DiscreteUniformDistribution</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(在 Python v3.8)">float</a></span></em>, <em class="sig-param"><span class="n">high</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(在 Python v3.8)">float</a></span></em>, <em class="sig-param"><span class="n">q</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(在 Python v3.8)">float</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#DiscreteUniformDistribution"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.DiscreteUniformDistribution" title="永久链接至目标">¶</a></dt>
<dd><p>线性离散均匀分布</p>
<p>该对象由 <a class="reference internal" href="trial.html#optuna.trial.Trial.suggest_discrete_uniform" title="optuna.trial.Trial.suggest_discrete_uniform"><code class="xref py py-func docutils literal notranslate"><span class="pre">suggest_discrete_uniform()</span></code></a> 进行实例化之后会被传递到 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a></p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>如果区间 <span class="math notranslate nohighlight">\([\mathsf{low}, \mathsf{high}]\)</span> 不能被步数 <span class="math notranslate nohighlight">\(q\)</span> 整除的话， 值 <span class="math notranslate nohighlight">\(\mathsf{high}\)</span> 会被替代成 <span class="math notranslate nohighlight">\(k q + \mathsf{low} \lt \mathsf{high}\)</span> 的最大值，其中 <span class="math notranslate nohighlight">\(k\)</span> 是整数。</p>
</div>
<dl class="py attribute">
<dt id="optuna.distributions.DiscreteUniformDistribution.low">
<code class="sig-name descname">low</code><a class="headerlink" href="#optuna.distributions.DiscreteUniformDistribution.low" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围下界。其中 <code class="docutils literal notranslate"><span class="pre">low</span></code> 值是包含在取值范围内的。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.distributions.DiscreteUniformDistribution.high">
<code class="sig-name descname">high</code><a class="headerlink" href="#optuna.distributions.DiscreteUniformDistribution.high" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围上界。其中 <code class="docutils literal notranslate"><span class="pre">high</span></code> 值是包含在取值范围内的。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.distributions.DiscreteUniformDistribution.q">
<code class="sig-name descname">q</code><a class="headerlink" href="#optuna.distributions.DiscreteUniformDistribution.q" title="永久链接至目标">¶</a></dt>
<dd><p>离散化步骤。</p>
</dd></dl>

<dl class="py method">
<dt id="optuna.distributions.DiscreteUniformDistribution.single">
<code class="sig-name descname">single</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#DiscreteUniformDistribution.single"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.DiscreteUniformDistribution.single" title="永久链接至目标">¶</a></dt>
<dd><p>测试该分布范围内是否仅包含一个可能的值。</p>
<p>如果该方法返回 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 则 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a> 总从该分布中取同一个值。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>当分布的范围内仅包含一个值时该值为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 否则为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="optuna.distributions.IntUniformDistribution">
<em class="property">class </em><code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">IntUniformDistribution</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span></em>, <em class="sig-param"><span class="n">high</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span></em>, <em class="sig-param"><span class="n">step</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#IntUniformDistribution"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.IntUniformDistribution" title="永久链接至目标">¶</a></dt>
<dd><p>整数上的均匀分布。</p>
<p>该对象由 <a class="reference internal" href="trial.html#optuna.trial.Trial.suggest_int" title="optuna.trial.Trial.suggest_int"><code class="xref py py-func docutils literal notranslate"><span class="pre">suggest_int()</span></code></a> 进行实例化之后会被传递到 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a></p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>如果区间 <span class="math notranslate nohighlight">\([\mathsf{low}, \mathsf{high}]\)</span> 不能被步数 <span class="math notranslate nohighlight">\(\mathsf{step}\)</span> 整除的话， 值 <span class="math notranslate nohighlight">\(\mathsf{high}\)</span> 会被替代成 <span class="math notranslate nohighlight">\(k \times \mathsf{step} + \mathsf{low} \lt \mathsf{high}\)</span> 的最大值，其中 <span class="math notranslate nohighlight">\(k\)</span> 是整数。</p>
</div>
<dl class="py attribute">
<dt id="optuna.distributions.IntUniformDistribution.low">
<code class="sig-name descname">low</code><a class="headerlink" href="#optuna.distributions.IntUniformDistribution.low" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围下界。其中 <code class="docutils literal notranslate"><span class="pre">low</span></code> 值是包含在取值范围内的。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.distributions.IntUniformDistribution.high">
<code class="sig-name descname">high</code><a class="headerlink" href="#optuna.distributions.IntUniformDistribution.high" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围上界。其中 <code class="docutils literal notranslate"><span class="pre">high</span></code> 值是包含在取值范围内的。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.distributions.IntUniformDistribution.step">
<code class="sig-name descname">step</code><a class="headerlink" href="#optuna.distributions.IntUniformDistribution.step" title="永久链接至目标">¶</a></dt>
<dd><p>取值间隔步长。</p>
</dd></dl>

<dl class="py method">
<dt id="optuna.distributions.IntUniformDistribution.single">
<code class="sig-name descname">single</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#IntUniformDistribution.single"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.IntUniformDistribution.single" title="永久链接至目标">¶</a></dt>
<dd><p>测试该分布范围内是否仅包含一个可能的值。</p>
<p>如果该方法返回 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 则 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a> 总从该分布中取同一个值。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>当分布的范围内仅包含一个值时该值为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 否则为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="optuna.distributions.IntLogUniformDistribution">
<em class="property">class </em><code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">IntLogUniformDistribution</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span></em>, <em class="sig-param"><span class="n">high</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span></em>, <em class="sig-param"><span class="n">step</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#IntLogUniformDistribution"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.IntLogUniformDistribution" title="永久链接至目标">¶</a></dt>
<dd><p>Log 操作后的整数均匀分布。</p>
<p>该对象由 <a class="reference internal" href="trial.html#optuna.trial.Trial.suggest_int" title="optuna.trial.Trial.suggest_int"><code class="xref py py-func docutils literal notranslate"><span class="pre">suggest_int()</span></code></a> 进行实例化之后会被传递到 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a></p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>如果区间 <span class="math notranslate nohighlight">\([\mathsf{low}, \mathsf{high}]\)</span> 不能被步数 <span class="math notranslate nohighlight">\(\mathsf{step}\)</span> 整除的话， 值 <span class="math notranslate nohighlight">\(\mathsf{high}\)</span> 会被替代成 <span class="math notranslate nohighlight">\(k \times \mathsf{step} + \mathsf{low} \lt \mathsf{high}\)</span> 的最大值，其中 <span class="math notranslate nohighlight">\(k\)</span> 是整数。</p>
</div>
<dl class="py attribute">
<dt id="optuna.distributions.IntLogUniformDistribution.low">
<code class="sig-name descname">low</code><a class="headerlink" href="#optuna.distributions.IntLogUniformDistribution.low" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围下界。其中 <code class="docutils literal notranslate"><span class="pre">low</span></code> 值是包含在取值范围内的。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.distributions.IntLogUniformDistribution.high">
<code class="sig-name descname">high</code><a class="headerlink" href="#optuna.distributions.IntLogUniformDistribution.high" title="永久链接至目标">¶</a></dt>
<dd><p>该分布的取值范围上界。其中 <code class="docutils literal notranslate"><span class="pre">high</span></code> 值是包含在取值范围内的。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.distributions.IntLogUniformDistribution.step">
<code class="sig-name descname">step</code><a class="headerlink" href="#optuna.distributions.IntLogUniformDistribution.step" title="永久链接至目标">¶</a></dt>
<dd><p>取值间隔步长。</p>
</dd></dl>

<dl class="py method">
<dt id="optuna.distributions.IntLogUniformDistribution.single">
<code class="sig-name descname">single</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#IntLogUniformDistribution.single"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.IntLogUniformDistribution.single" title="永久链接至目标">¶</a></dt>
<dd><p>测试该分布范围内是否仅包含一个可能的值。</p>
<p>如果该方法返回 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 则 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a> 总从该分布中取同一个值。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>当分布的范围内仅包含一个值时该值为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 否则为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="optuna.distributions.CategoricalDistribution">
<em class="property">class </em><code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">CategoricalDistribution</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">choices</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#CategoricalDistribution"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.CategoricalDistribution" title="永久链接至目标">¶</a></dt>
<dd><p>分类分布。</p>
<p>该对象由 <a class="reference internal" href="trial.html#optuna.trial.Trial.suggest_categorical" title="optuna.trial.Trial.suggest_categorical"><code class="xref py py-func docutils literal notranslate"><span class="pre">suggest_categorical()</span></code></a> 进行实例化之后会被传递到 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a></p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>choices</strong> -- 可选参数值</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>不是所有类型的参数都一定能和optuna的存储引擎兼容，请尽量使用 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a>, <a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a>, <a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>, <a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(在 Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code></a> 或者 <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>.</p>
</div>
<dl class="py attribute">
<dt id="optuna.distributions.CategoricalDistribution.choices">
<code class="sig-name descname">choices</code><a class="headerlink" href="#optuna.distributions.CategoricalDistribution.choices" title="永久链接至目标">¶</a></dt>
<dd><p>可选参数值</p>
</dd></dl>

<dl class="py method">
<dt id="optuna.distributions.CategoricalDistribution.single">
<code class="sig-name descname">single</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#CategoricalDistribution.single"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.CategoricalDistribution.single" title="永久链接至目标">¶</a></dt>
<dd><p>测试该分布范围内是否仅包含一个可能的值。</p>
<p>如果该方法返回 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 则 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-mod docutils literal notranslate"><span class="pre">samplers</span></code></a> 总从该分布中取同一个值。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>当分布的范围内仅包含一个值时该值为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>, 否则为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="optuna.distributions.distribution_to_json">
<code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">distribution_to_json</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dist</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#distribution_to_json"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.distribution_to_json" title="永久链接至目标">¶</a></dt>
<dd><p>将分布序列化成json格式</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>dist</strong> -- 待序列化的分布</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p>输出的 JSON 文件名</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="optuna.distributions.json_to_distribution">
<code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">json_to_distribution</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">json_str</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#json_to_distribution"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.json_to_distribution" title="永久链接至目标">¶</a></dt>
<dd><p>将 JSON 格式的分布反序列化</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>json_str</strong> -- 已序列化的分布</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p>已反序列化的分布</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="optuna.distributions.check_distribution_compatibility">
<code class="sig-prename descclassname">optuna.distributions.</code><code class="sig-name descname">check_distribution_compatibility</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dist_old</span></em>, <em class="sig-param"><span class="n">dist_new</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/distributions.html#check_distribution_compatibility"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.distributions.check_distribution_compatibility" title="永久链接至目标">¶</a></dt>
<dd><p>检查两分布的兼容性</p>
<p>注意，该方法不应由 optuna 用户来调用</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dist_old</strong> -- 从存储内容中恢复的分布</p></li>
<li><p><strong>dist_new</strong> -- 新添加到存储内容的分布</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p>如果是 True 的话，表明这些分布是兼容的，否则不兼容。</p>
</dd>
</dl>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="exceptions.html" class="btn btn-neutral float-right" title="Exceptions" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="cli.html" class="btn btn-neutral float-left" title="Command Line Interface" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, Optuna Contributors.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
    <a href="../privacy.html">Privacy Policy</a>.
     


</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
    <!-- Theme Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-55135190-8', 'auto');
    ga('send', 'pageview');
    </script>

    
   

</body>
</html>